<%#*************************************************** プロジェクトセレクタ %>
<%= @restrict_project ? Project.find(@restrict_project).name : ""%>

<select onchange="if (this.value != '') {window.location = this.value;}">
  <option selected="selectes"><%=l(:wt_select_project)%></option>
  <option value="<%= url_for(@link_params.merge(:prj=>false));%>">---</option>
<%
prjs = Project.find(:all, :joins=>"LEFT JOIN wt_project_orders ON wt_project_orders.dsp_prj=projects.id AND wt_project_orders.uid=#{User.current.id}",
                          :select=>"projects.*, coalesce(wt_project_orders.dsp_pos,100000) as pos",
                          :order=>"pos,name")
prjs.each do |prj|
  next unless prj.active?
  next if !prj.visible?
%>
  <option value="<%= url_for(@link_params.merge(:prj=>prj.id));%>"> <%=prj.name%> </option>
<%end%>
</select>
